<template>
<div>
    <el-dialog :title="title" :visible.sync="dialogFormVisble" :rules="rules" :close-on-click-modal="false" @close="closeDialog">
        <el-form :model="selectTable" :rules="rules" ref="selectTable" size="small" label-width="150px">
          <el-form-item label="设备类型："  prop="mode">
            <el-select v-model="selectTable.mode" placeholder="设备类型">
              <el-option key="1" label="DH-0001" value="1"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="设备ID："  prop="id">
            <el-input v-model="selectTable.id" placeholder="请输入设备ID"></el-input>
          </el-form-item>

          <el-form-item label="设备名称：" prop="name">
            <el-input v-model="selectTable.name" placeholder="请输入设备名称"></el-input>
          </el-form-item>

          <el-form-item label="设备MAC：" prop="mac">
            <el-input v-model="selectTable.mac" placeholder="请输入设备MAC"></el-input>
          </el-form-item>
        </el-form>

        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisble = false">取 消</el-button>
          <el-button type="primary" @click="nextStep()">下一步</el-button>
        </div>
      </el-dialog>
       <merchant v-if="merchantFinishDialog.show" :isShow="merchantFinishDialog.show"  @closeDialog="hideMerchantFinishDialog" :title="title"></merchant>
</div>
</template>
<script>
import Merchant from '@/components/netbox/merchant'
export default {
    data() {
        return {
            dialogFormVisble: this.isShow,
            merchantFinishDialog: {show: false},
            selectTable: {
                type: '1'
            },
            addEqu: true,
            rules: {
                mode: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
                id: [{ required: true, message: '请输入设备ID', trigger: 'blur' }],
                name: [{ required: true, message: '请输入设备名称', trigger: 'blur' }],
                mac: [{ required: true, message: '请输入设备MAC', trigger: 'blur' }],
            }
        }
    },
    components: {Merchant},
    props:['isShow', 'title'],
    methods: {
        //设置弹窗可见
        closeDialog() {
            this.$emit('closeDialog')
        },
        updateDevice() {
            this.dialogFormVisble = true
            this.title = '修改设备'
        },
        hideMerchantFinishDialog() {
            this.merchantFinishDialog.show = false
        },
        confirmDialog() {},
        nextStep() {
          this.merchantFinishDialog.show = true
        }
    }
}
</script>
<style lang="less" scoped>

</style>

